#  迭代  iteration 获取最大 最小的值
from idlelib.macosx import isXQuartz


def find_val(l):
    if not l:
        return None,None
    min_val = max_val=l[0]
    for i in l :
        if min_val>i:
            min_val=i
        if max_val<i:
            max_val=i
    return min_val,max_val

for x in [1,2,3,4,5]:
    pass

#等价于
it = iter([1,2,3,4,5])
while True:
    try:
        x=next(it)
    except StopIteration:
        break

